import Layout from '@/layout'
import RouteButtonsBuilder from '@/framework/infra/router/RouterButtonsBuilder'
import TableButtonType from '@/framework/constant/TableButtonType';

export default [
  {
    path: '/lms',
    component: Layout,
    meta: {title: '商家推荐', icon: 'el-icon-s-help'},
    children: [
      {
        path: 'shop',
        component: () => import('@/feature/lms/app/shop/index'),
        meta: {title: '商家推荐', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('lms:shop')
          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'goodsManager',
              name: 'lms:shop-goods:list',
              type: TableButtonType.ROW,
              label: '商品管理',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'create',
              type: TableButtonType.TOOLBAR,
              label: '新建商家',
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'remove',
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            },
            {
              handler: 'list',
              groupId: 1,
              name: 'goods-list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'goods-export',
              groupId: 1,
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            {
              handler: 'create',
              name: 'goods-create',
              type: TableButtonType.TOOLBAR,
              label: '新建商品',
              groupId: 1,
              icon: 'el-icon-plus'
            },
            {
              handler: 'update',
              name: 'goods-update',
              groupId: 1,
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            },
            {
              handler: 'remove',
              name: 'goods-remove',
              groupId: 1,
              type: TableButtonType.ROW,
              label: '删除',
              buttonType: 'danger',
              icon: 'el-icon-delete'
            }
          ])
          .build()
      },
      {
        path: 'tag',
        component: () => import('@/feature/lms/app/tag/index'),
        meta: {title: '标签管理', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('lms:tag')
          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            // {
            //   handler: 'create',
            //   name: 'create',
            //   type: TableButtonType.TOOLBAR,
            //   label: '新建标签',
            //   icon: 'el-icon-plus'
            // },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            }
            // {
            //   handler: 'remove',
            //   name: 'remove',
            //   type: TableButtonType.ROW,
            //   label: '删除',
            //   buttonType: 'danger',
            //   icon: 'el-icon-delete'
            // }

          ])
          .build()
      },
      {
        path: 'shop-category',
        component: () => import('@/feature/lms/app/shop-category/index'),
        meta: {title: '商家分类', icon: 'table'},
        buttons: RouteButtonsBuilder.builder('lms:shop-category')

          .addButtons([
            {
              handler: 'list',
              name: 'list',
              type: TableButtonType.SEARCHBAR,
              label: '搜索',
              icon: 'el-icon-search'
            },
            {
              handler: 'export',
              name: 'export',
              type: TableButtonType.TOOLBAR_RIGHT,
              label: '导出',
              buttonType: 'primary',
              icon: 'el-icon-download'
            },
            // {
            //   handler: 'create',
            //   name: 'create',
            //   type: TableButtonType.TOOLBAR,
            //   label: '新建商家分类',
            //   icon: 'el-icon-plus'
            // },
            {
              handler: 'update',
              name: 'update',
              type: TableButtonType.ROW,
              label: '修改',
              icon: 'el-icon-edit'
            }
            // {
            //   handler: 'remove',
            //   name: 'remove',
            //   type: TableButtonType.ROW,
            //   label: '删除',
            //   buttonType: 'danger',
            //   icon: 'el-icon-delete'
            // }
          ])
          .build()
      }
      // #appendSpot# 生成工具用，不要删了
    ]
  }
]
